import axios from "axios";

const hunru = {
    data() {
        return {
            lists: [],
            username: '',
            is_accepted:true
        }
    },
    created() {
        axios.get('http://127.0.0.1:8000/api/friend/', {
                headers: {
                    token: sessionStorage.getItem('token')
                },
                params: {
                    username: sessionStorage.getItem('username'),
                    is_accepted:this.is_accepted
                }
            }
        ).then(response => {
            this.lists = response.data.results
            this.username = sessionStorage.getItem('username')
        })
            .catch(error => {
                console.log(error);
            });
    },
}
export default hunru